import java.util.Scanner;

public class Main1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        while (scanner.hasNextInt()) {
            int n = scanner.nextInt();
            int count = 0;
            while (n > 0) {
                if (n % 2 == 1) {
                    count++;
                }
                n /= 2;
            }
            System.out.println(count);
        }
    }
}
